package com.example.rabbit.enums;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;

/**
 * @description: fanout交换机
 */
@Getter
public enum FanoutEnum {

    /**
     * 火币k线
     */
    HUOBI_K_LINE("huobi_k_line", "#", 1000),
    ;


    private String exchange;


    private String routingKey;

    /**
     * 消息存活时间,该参数是非负整数值.创建queue时设置该参数可指定消息在该queue中待多久，
     */
    private Integer ttl;


    FanoutEnum(String exchange, String routingKey) {
        this.exchange = exchange;
        this.routingKey = routingKey;
    }

    FanoutEnum(String exchange, String routingKey, Integer ttl) {
        this.exchange = exchange;
        this.routingKey = routingKey;
        this.ttl = ttl;
    }

    public String objName() {
        return StrUtil.format("{}_queue", this.exchange);
    }

}
